package com.gxd.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gxd.common.core.domain.MpBaseEntity;
import com.gxd.common.utils.GUID;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author gxd
 * @since 2025/6/14
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "t_allocation_customer_log", autoResultMap = true)
@ApiModel(description = "客户资源分配日志表")
public class AllocationCustomerLog extends MpBaseEntity {

    public void setGUID() {
        this.id = new GUID().toString();
    }

    @ApiModelProperty(value = "日志id")
    @TableId(type = IdType.INPUT)
    private String id;

    @ApiModelProperty(value = "资源客户Id")
    private String customerId;

    @ApiModelProperty(value = "用户Id（原分配）")
    private Long fromUserId;

    @ApiModelProperty(value = "用户id（新分配）")
    private Long toUserId;

    @ApiModelProperty(value = "分配时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date assignTime;

    @ApiModelProperty(value = "状态（1分配 2转移）")
    private Integer type;
}
